<?php

namespace Modules\Buy\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class GoodRequest extends FormRequest
{
    //验证规则
    public function rules()
    {
        return array (
          'title' => 'required',
          'mallprice' => 'required',
          'iscommend' => 'required',
           'can_id'=>'required'
);
    }

    //错误信息处理
    public function messages()
    {
        return array (
          'title.required' => '请设置 商品名称',
          'mallprice.required' => '请设置 商城价',
          'iscommend.required' => '请设置 是否推荐',
           'can_id.required'=>'可用属性不能为空'
);
    }

    //权限验证
    public function authorize()
    {
        return true;
    }
}
